package com.example.user.dao.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.user.enums.RoleType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("role")
public class Role {
    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("role")
    private RoleType role;

    @TableField("is_super")
    private Integer isSuper;

    @TableField("create_time")
    private Date createTime;

    @TableField("update_time")
    private Date updateTime;
}

//CREATE TABLE `role` (
//    `id` BIGINT NOT NULL AUTO_INCREMENT,
//    `role` VARCHAR(20) NOT NULL,
//    `is_super` INT NOT NULL DEFAULT 0,
//    `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
//    `update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
//    PRIMARY KEY (`id`),
//    UNIQUE KEY `uniq_role` (`role`)
//    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;